package com.qianyu.project.web.controller.smj;

import com.baomidou.mybatisplus.extension.api.R;
import com.qianyu.project.entity.ProjectType;
import com.qianyu.project.service.smj.smjProviderInfoService;
import com.qianyu.project.utils.Result;
import com.qianyu.project.utils.ResultTool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("smj_provider")
public class smjProviderInfo {

    @Autowired
    private smjProviderInfoService ps;

    @GetMapping("")
    public Result list(@RequestParam Map<String,String> params){
        Map<String, Object> map =new HashMap<>();
        //查询所有项目类型
        List<Map<String,Object>> providerType = ps.list();
        map.put("type", providerType);
        //查询所有项目
        map.put("data", ps.providerList(params));
        return ResultTool.success(map);
    }

    @GetMapping("/getEmp")
    public Result getEmp(@RequestParam Map<String,String> params){
        Map<String, Object> map =new HashMap<>();
        //查询所有项目类型
        List<Map<String,Object>> Dept = ps.getDept();
        map.put("type", Dept);
        //查询所有项目
        map.put("data", ps.getEmp(params));
        return ResultTool.success(map);
    }

    @GetMapping("/getLaber")
    public Result getLaber(@RequestParam Map<String,String> params){
        Map<String, Object> map =new HashMap<>();
        //查询合同
        map.put("data", ps.getLaber(params));
        return ResultTool.success(map);
    }

    @GetMapping("/attachemen_info")
    public List<Map<String,Object>> attachemeninfo(String id){
        return ps.attachemeninfo(id);
    }

    @GetMapping("/getBank")
    public Result getBank(@RequestParam Map<String,String> params){
        Map<String, Object> map =new HashMap<>();
        //查询合同
        map.put("data", ps.getBank(params));
        return ResultTool.success(map);
    }
}
